<%--
  Created by IntelliJ IDEA.
  User: l
  Date: 2023/6/22
  Time: 15:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="menu.jsp"%>
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="/admin/admin_index">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">订单管理</span></div>
    </div>
    <div class="result-wrap">
        <form name="myform" id="myform" method="post">
            <div class="result-content">
                <table class="result-tab" width="100%">
                    <tr>
                        <th>ID</th>
                        <th>买家</th>
                        <th>卖家</th>
                        <th>金额</th>
                        <th>商品名称</th>
                        <th>订单状态</th>
                        <th>订单生成时间</th>
                        <th>操作</th>
                    </tr>
                    <%--从后台获取的数据循环--%>
                    <c:forEach var="o" items="${orderList}">
                        <c:if test="${o.state != '4'}">
                            <tr>
                                <td>${o.id}</td>
                                <td>${o.username}</td>
                                <td>${o.shopname}</td>
                                <td>${o.price}</td>
                                <td>${o.productname}</td>
                                <td>
                                    <c:if test="${o.state == '0'}">待商家确认</c:if>
                                    <c:if test="${o.state == '1'}">待上传支付凭证</c:if>
                                    <c:if test="${o.state == '2'}">待商家再次确认</c:if>
                                    <c:if test="${o.state == '3'}">交易完成</c:if>
                                </td>
                                <td>${o.createTime}</td>
                                <td>
                                    <a class="link-update" href="/admin/admin_selectOrderById?id=${o.id}&cp=${page}">修改</a>
                                        <a class="link-del" href="javascript:Delete('你确定要删除订单【${o.id}】吗？','/admin/admin_deleteOrder?id=${o.id}&cp=${page}')">删除</a>
                                </td>
                            </tr>
                        </c:if>
                    </c:forEach>
                    <script>
                        //提示
                        function Delete(mess,url){
                            if(confirm(mess)){
                                location.href=url;
                            }
                        }
                    </script>
                </table>
                <div class="list-page">
                    <a href="/admin/admin_order?cp=1">首页</a>
                    <c:if test="${page != 1}"><a href="/admin/admin_order?cp=${page-1}">上一页</a></c:if>
                    ${sum} 条 ${page}/${cpage} 页
                    <c:if test="${page != cpage}"><a href="/admin/admin_order?cp=${page+1}">下一页</a></c:if>
                    <a href="/admin/admin_order?cp=${cpage}">尾页</a>
                </div>
            </div>
        </form>
    </div>
</div>
<!--/main-->
</div>
</body>
</html>
